import React, { Component } from 'react'
// 引入需要使用antd组件
import { DatePicker } from 'antd'
import { Button } from 'antd'
// 引入封装的组件
import Loading from './components/Loading'
import Captcha from './components/Captcha'
export default class App extends Component {
  state = {
    key: ''
  }
  // 父组件定义方法,下传给子组件
  saveKey = (key) => {
    // 子组件调用该方法,传递参数 并修改state的key值
    this.setState({ key })
  }
  render() {
    return (
      <div>
        {/* <div>
          <DatePicker></DatePicker>
        </div>
        <div>
          <Button type="danger">按钮</Button>
        </div>
        <div>
          <Loading></Loading>
          <Loading size="small" tip="请求中..."></Loading>
        </div> */}
        <div>
          {/* 下传方法 */}
          <Captcha saveKey={this.saveKey}></Captcha>
        </div>
      </div>
    )
  }
}
